#pragma once

#define __always_inline inline

#define __noreturn

#ifndef __weak
#define __weak __attribute__((__weak__))
#endif

#define __aligned(x) __attribute__((__aligned__(x)))

#define __must_check

/*
 *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-cleanup-variable-attribute
 * clang: https://clang.llvm.org/docs/AttributeReference.html#cleanup
 */
#define __cleanup(func) __attribute__((__cleanup__(func)))

#define __used __attribute__((__used__))

/*
 *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-section-function-attribute
 *   gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html#index-section-variable-attribute
 * clang: https://clang.llvm.org/docs/AttributeReference.html#section-declspec-allocate
 */
#define __section(section) __attribute__((__section__(section)))

#define __maybe_unused

/* fallthrough */
#define fallthrough \
    do              \
    {               \
    } while (0) 
